<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<jsp:include page="../../comunes/header.jsp" />
<h2>Nuevo Supervisor/Responsable de Zona</h2>
<form:form method="POST" modelAttribute="responsableZona">
   <table class="tbl_formulario">
      <tr><th>Empleado:</th>
         <td>
            <spring:bind path="llave.codigoEmpleado">
               <select name="llave.codigoEmpleado">
                  <c:forEach items="${empleados}" var="empleado">
                     <option value="${empleado.codigo}">
                        ${empleado.nombre} ${empleado.apellidoPaterno} ${empleado.apellidoMaterno}
                     </option>
                  </c:forEach>
               </select>
            </spring:bind>
            <form:errors path="llave" cssClass="error" />
         </td>
      </tr>
      <tr><th>Zona:</th>
         <td><form:select path="llave.claveZona" items="${zonas}" 
                      itemValue="clave" itemLabel="descripcion"/>
            <form:errors path="llave" cssClass="error" />
         </td>
      </tr>
      <tr><th>Plantas:</th>
         <td>
            <form:radiobutton path="plantas" value="S" label="Si" />
            <form:radiobutton path="plantas" value="N" label="No"/>
            <form:errors path="plantas" cssClass="error" />
         </td>
      </tr>
      <tr><th>Veh&iacute;culos:</th>
         <td>
            <form:radiobutton path="vehiculos" value="S" label="Si" />
            <form:radiobutton path="vehiculos" value="N" label="No"/>
            <form:errors path="vehiculos" cssClass="error" />
         </td>
      </tr>
      <tr><th>Bombas:</th>
         <td>
            <form:radiobutton path="bombas" value="S" label="Si" />
            <form:radiobutton path="bombas" value="N" label="No"/>
            <form:errors path="bombas" cssClass="error" />
         </td>
      </tr>
      <tr><th>Comentarios:</th>
         <td>
            <form:textarea path="comentarios" cols="60" rows="2" maxlength="250"/>
            <form:errors path="comentarios" cssClass="error" />
         </td>
      </tr>
      <tr>
         <td><button type="reset" class="btn_regresar" title="Regresar">Regresar</button></td>
         <td><button type="submit" class="btn_guardar" title="Guardar">Guardar</button></td>
      </tr>
   </table>
</form:form><c:url var="regrUrl" value="/catalogos/responsablesz" />
<script type="text/javascript">
   $(document).ready(function() {
      $("#clave").focus();
      $(".btn_regresar").click(function() {
         window.location.replace('${regrUrl}');
      });
   });
</script>
<jsp:include page="../../comunes/footer.jsp" />